package by.grsu.hdm.media;

import by.grsu.hdm.exceptions.IllegalInternalStateException;


public class MediaPlayer implements IMediaPlayer,IRemoteControlSupport  {
	
	protected static String play;
	protected static String pause;
	protected static String stop;
	RemoteControl remoteControl;
	
	public MediaPlayer(){
		
	}
	
	
	public void play() throws IllegalInternalStateException{
		play="play";
		pause=null;
		stop=null;
	}
	
	public void pause(){
		pause="pause";
		play=null;
		stop=null;
	}
	
	public void stop(){
		stop="stop";
		pause=null;
		play=null;
	}
	
	public void playerStatus(){
		if (play != null)
			System.out.println("MediaPlayer is playing");
	    if (pause != null)
			System.out.println("MediaPlayer on pause");
		if (stop != null)
			System.out.println("MediaPlayer is stopped");
	}
	
	public RemoteControl getRemoteControl(){
		
		if(this.remoteControl == null){
			this.remoteControl = new RemoteControl();
		}
		
		return this.remoteControl;
	}
}
